package com.gitee.huanminabc;


import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.Banner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
@EnableAspectJAutoProxy(proxyTargetClass = true) //开启AOP的动态代理,这样可以不用实现接口就能使用AOP
@MapperScan({"com.gitee.huanminabc.**.dal.mapper"})
@EnableTransactionManagement
@EnableScheduling
@Slf4j
public class ProjectBaseApplication {
    public static void main(String[] args) {
        try {
            //启动springboot,这里只是为了使用springboot的一些工具(容器,注解,AOP啥的)
            SpringApplication springApplication = new SpringApplication(ProjectBaseApplication.class);
            //去掉springboot的banner
            springApplication.setBannerMode((Banner.Mode.OFF));
            //设置为非web项目,不会启动tomcat
            springApplication.setWebApplicationType(WebApplicationType.NONE);
            springApplication.run(args);
            log.info("Application '{}' is running!", "ProjectApplication");

            System.out.println("======================结束=========================");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
